.class public Lcom/adview/adapters/MdotMAdapter;
.super Lcom/adview/adapters/AdViewAdapter;
.source "MdotMAdapter.java"

# interfaces
.implements Lcom/mdotm/android/ads/MdotMView$MdotMActionListener;


# direct methods
.method public constructor <init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V
    .locals 0
    .parameter "adViewLayout"
    .parameter "ration"

    .prologue
    .line 26
    invoke-direct {p0, p1, p2}, Lcom/adview/adapters/AdViewAdapter;-><init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V

    .line 27
    return-void
.end method


# virtual methods
.method public adRequestCompletedSuccessfully(Lcom/mdotm/android/ads/MdotMView;)V
    .locals 3
    .parameter "adView"

    .prologue
    .line 61
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 62
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "MdotM success"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 64
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/mdotm/android/ads/MdotMView;->setListener(Lcom/mdotm/android/ads/MdotMView$MdotMActionListener;)V

    .line 66
    iget-object v1, p0, Lcom/adview/adapters/MdotMAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 67
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 76
    :goto_0
    return-void

    .line 72
    :cond_1
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/mdotm/android/ads/MdotMView;->setVisibility(I)V

    .line 73
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover()V

    .line 74
    iget-object v1, v0, Lcom/adview/AdViewLayout;->handler:Landroid/os/Handler;

    new-instance v2, Lcom/adview/AdViewLayout$ViewAdRunnable;

    invoke-direct {v2, v0, p1}, Lcom/adview/AdViewLayout$ViewAdRunnable;-><init>(Lcom/adview/AdViewLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 75
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedDelayed()V

    goto :goto_0
.end method

.method public adRequestFailed(Lcom/mdotm/android/ads/MdotMView;)V
    .locals 3
    .parameter "adView"

    .prologue
    .line 81
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 82
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "MdotM failure"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 84
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/mdotm/android/ads/MdotMView;->setListener(Lcom/mdotm/android/ads/MdotMView$MdotMActionListener;)V

    .line 86
    iget-object v1, p0, Lcom/adview/adapters/MdotMAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 87
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 93
    :goto_0
    return-void

    .line 90
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover_pri()V

    .line 91
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedPri()V

    goto :goto_0
.end method

.method public handle()V
    .locals 9

    .prologue
    .line 32
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v6

    sget-object v7, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v6, v7, :cond_0

    .line 33
    const-string v6, "AdView SDK v1.7.0"

    const-string v7, "Into MdotM"

    invoke-static {v6, v7}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 34
    :cond_0
    iget-object v6, p0, Lcom/adview/adapters/MdotMAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v6}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/adview/AdViewLayout;

    .line 35
    .local v1, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v1, :cond_2

    .line 56
    :cond_1
    :goto_0
    return-void

    .line 40
    :cond_2
    iget-object v6, v1, Lcom/adview/AdViewLayout;->activityReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v6}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    .line 41
    .local v0, activity:Landroid/app/Activity;
    if-eqz v0, :cond_1

    .line 44
    iget-object v3, v1, Lcom/adview/AdViewLayout;->extra:Lcom/adview/obj/Extra;

    .line 45
    .local v3, extra:Lcom/adview/obj/Extra;
    iget v6, v3, Lcom/adview/obj/Extra;->bgRed:I

    iget v7, v3, Lcom/adview/obj/Extra;->bgGreen:I

    iget v8, v3, Lcom/adview/obj/Extra;->bgBlue:I

    invoke-static {v6, v7, v8}, Landroid/graphics/Color;->rgb(III)I

    move-result v2

    .line 46
    .local v2, bgColor:I
    iget v6, v3, Lcom/adview/obj/Extra;->fgRed:I

    iget v7, v3, Lcom/adview/obj/Extra;->fgGreen:I

    iget v8, v3, Lcom/adview/obj/Extra;->fgBlue:I

    invoke-static {v6, v7, v8}, Landroid/graphics/Color;->rgb(III)I

    move-result v4

    .line 48
    .local v4, fgColor:I
    iget-object v6, p0, Lcom/adview/adapters/MdotMAdapter;->ration:Lcom/adview/obj/Ration;

    iget-object v6, v6, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    invoke-static {v6}, Lcom/mdotm/android/ads/MdotMManager;->setPublisherId(Ljava/lang/String;)V

    .line 49
    const-string v6, "AdView SDK v1.7.0"

    invoke-static {v6}, Lcom/mdotm/android/ads/MdotMManager;->setMediationLayerName(Ljava/lang/String;)V

    .line 50
    const/16 v6, 0xaa

    invoke-static {v6}, Lcom/mdotm/android/ads/MdotMManager;->setMediationLayerVersion(I)V

    .line 52
    new-instance v5, Lcom/mdotm/android/ads/MdotMView;

    invoke-direct {v5, v0, p0}, Lcom/mdotm/android/ads/MdotMView;-><init>(Landroid/content/Context;Lcom/mdotm/android/ads/MdotMView$MdotMActionListener;)V

    .line 53
    .local v5, mdotm:Lcom/mdotm/android/ads/MdotMView;
    invoke-virtual {v5, v2}, Lcom/mdotm/android/ads/MdotMView;->setBackgroundColor(I)V

    .line 54
    invoke-virtual {v5, v4}, Lcom/mdotm/android/ads/MdotMView;->setTextColor(I)V

    .line 55
    invoke-virtual {v5, p0}, Lcom/mdotm/android/ads/MdotMView;->setListener(Lcom/mdotm/android/ads/MdotMView$MdotMActionListener;)V

    goto :goto_0
.end method
